package pers.lt.hibernatebeans;

import javax.persistence.*;

/**
 * Created by gjj on 2018/1/16.
 */
@Entity(name = "ROLE_RIGHTS_INFO")
public class RoleRightsInfoEntity {
    private String id;
    private String rightId;
    private String roleId;

    @Id
    @Column(name = "ID", nullable = false, length = 255)
    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    @Basic
    @Column(name = "RIGHT_ID", nullable = true, length = 255)
    public String getRightId() {
        return rightId;
    }

    public void setRightId(String rightId) {
        this.rightId = rightId;
    }

    @Basic
    @Column(name = "ROLE_ID", nullable = true, length = 255)
    public String getRoleId() {
        return roleId;
    }

    public void setRoleId(String roleId) {
        this.roleId = roleId;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        RoleRightsInfoEntity that = (RoleRightsInfoEntity) o;

        if (id != null ? !id.equals(that.id) : that.id != null) return false;
        if (rightId != null ? !rightId.equals(that.rightId) : that.rightId != null) return false;
        if (roleId != null ? !roleId.equals(that.roleId) : that.roleId != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = id != null ? id.hashCode() : 0;
        result = 31 * result + (rightId != null ? rightId.hashCode() : 0);
        result = 31 * result + (roleId != null ? roleId.hashCode() : 0);
        return result;
    }
}
